
#include "orangepch.h"
#include "Renderer.h"
#include "Texture.h"
#include "Platform/OpenGl/OpenGlTexture.h"

namespace Orange {

	Ref<Texture2D> Texture2D::Create(const uint32_t& width, const uint32_t& height)
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None: ORANGE_CORE_ASSERT(false, " RenderApi is not support! "); return nullptr;
		case RendererAPI::API::OpenGl: return CreateRef<OpenGlTexture2D>(width, height);
		}

		ORANGE_CORE_ASSERT(false, " RenderApi unknown! ")
			return nullptr;

	}
	Ref<Texture2D> Texture2D::Create(const std::string& path)
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None: ORANGE_CORE_ASSERT(false, " RenderApi is not support! "); return nullptr;
		case RendererAPI::API::OpenGl: return CreateRef<OpenGlTexture2D>(path) ;
		}

		ORANGE_CORE_ASSERT(false, " RenderApi unknown! ")
			return nullptr;

	}
	

}